using System;

namespace GIC.DAO.Model
{
    [Serializable]
    public class EntityBase : IEquatable<EntityBase>
    {
        public virtual int Id { get; set; }
        public virtual DateTime dataOcorrencia { get; set; }

        public virtual bool Equals(EntityBase obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (GetType() != obj.GetType()) return false;
            return obj.Id == Id;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (GetType() != obj.GetType()) return false;
            return Equals((EntityBase)obj);
        }
    }
}